/*


	jQuery plugin: flashThumbLoader
	Author: Ian Hart at Grand Union [ianh@thegrandunion.com]


	What?
	=====
	Dynamically load SWF files from a list of links (e.g. thumbnails).


	How?
	====
	Links should point directly to a SWF file, e.g:

		<ul>
			<li><a href="movie-1.swf">My first movie</a></li>
			<li><a href="movie-2.swf">My second movie</a></li>
			<li><a href="movie-3.swf">My third movie</a></li>
		</ul>
		
	 Send the link elements through the jQuery object:
		
		$('ul a').flashThumbLoader();


	Options
	=======
	swfID: The ID of the element the SWF (embed/object element) will replace (the resulting embed/object element will inherit the ID).
	swfWidth: The width of the SWF.
	swfHeight: The height of the SWF.
	flashVer: The lowest version of Flash Player required to view the SWF.
	expressLocation: The location of expressInstall.swf for users without Flash Player installed.
	
	
	Dependencies
	============
	- jQuery 1.3.2  or higher (jquery.com)
	- SWFObject v2.2 (code.google.com/p/swfobject)


*/
(function($){

	$.fn.flashThumbLoader = function(settings){

		var G = {
			config : {
				swfID : 'my-movie',
				swfWidth : '100%',
				swfHeight : '100%',
				flashVer : '9.0.0',
				expressLocation : 'expressInstall.swf'
			},
			$links : this
		};
		
		if(settings){ $.extend(G.config, settings); }


		function init(){

			G.$links.click(function(event){
				event.preventDefault();
				swfobject.embedSWF($(this).attr('href'), G.config.swfID, G.config.swfWidth, G.config.swfHeight, G.config.flashVer, G.config.expressLocation);
			});
		
		}
		
		
		init();
		return this;
	
	};

})(jQuery);